#Debug/FMbTest: src/FMb.o test/FMbTest.o
#	g++ -Wall src/FMb.o test/FMbTest.o -o Debug/FMbTest

#src/FMb.o: src/FMb.cpp src/FMbTL.h src/FMbFn.h
#	g++ -Wall -c src/FMb.cpp -o src/FMb.o

#test/FMbTest.o: src/FMbTL.h src/FMbFn.h
#	g++ -Wall -c test/FMbTest.cpp -o test/FMbTest.o -I./src/

#clean:
#	rm Debug/FMbTest
#	rm test/FMbTest.o
#	rm src/FMb.o

#gcc -fPIC -g -c -Wall a.c
#gcc -fPIC -g -c -Wall b.c
#gcc -shared -Wl,-soname,libmystuff.so.1 -o libmystuff.so.1.0.1 a.o b.o -lc

#path = ../$(config)/
libfile = libfmbase.so


CPPFLAGS+= -fPIC

h_files = $(wildcard *.h)
cpp_files = $(wildcard *.cpp)
o_files = $(subst .cpp,.o,$(cpp_files))


all: $(libfile)

$(libfile): $(o_files)
	mkdir -p ../$(config) 
	gcc -shared -pthread -Wl,-soname,$(path)libfmbase.so.1 -o $(libfile) $(o_files) -lc

.PHONY: clean
clean:
	rm -f *.o
	rm -f $(libfile)

.PHONY: install
install:
	cp $(libfile) /usr/lib/
	rm -f /usr/lib/$(libfile).1
	ln -s /usr/lib/$(libfile) /usr/lib/$(libfile).1

#%.o: %.cpp $(h_files)
	
